import os, sys, time
from glob import glob

env = Environment()
if ARGUMENTS.get('release', '0') == '0':
    env.Append(CPPFLAGS = ['-O0', '-g3', '-Werror', '-std=c++11'])
else:
    env.Append(CPPFLAGS = ['-O3', '-g0', '-Werror', '-std=c++11'])
env.Append(CPPPATH = ['../', '/usr/local/include', '.'])
env.Append(CPPDEFINES={'_FILE_OFFSET_BITS' : '64', 
'DEBUG' : 1
})
env.Append(LIBPATH = ['/usr/local/lib'])
env.Append(LIBS=['pthread', 'dl', 'gflags', 'glog', 'tcmalloc', 'protobuf'])

source_files = glob('../test/serv/*.cc') + \
               glob('../rpc/module/*.cc') + \
               glob('../rpc/*.cc') + \
               glob('../base/*.cc') + \
               glob('../test/test_proto/*.cc')

print("souce code list: >>")
for s in source_files:
	print os.path.realpath(s)
print('')

env.Program('serv', source_files)
